# coding=utf-8
from flask import Flask

from App.apis import init_api
from App.ext import init_ext
from App.settings import envs
from App.views import init_views


def create_app():
    # 实例化 flask
    app = Flask(__name__)


    # 添加配置文件
    app.config.from_object(envs.get("develop"))

    # 添加第三方扩展库
    init_ext(app)
    # 添加视图
    init_views(app)
    init_api(app)

    # 添加钩子函数

    return app